import request from '@/utils/request'

//API常量
const APIS = {
    V1: "/v1"
}

// 任务列表
export function listTasks(params) {
  console.log(params)
  return request({
    url: APIS.V1 + `/system/creditLoanTask/listTasks`,
    method: 'get',
    params: params
  })
}

// 领取任务
export function receiveTask(taskId) {
  return request({
    url: APIS.V1 + `/system/creditLoanTask/claim?taskId=`+taskId,
    method: 'post',
  })
}

export function getReviewByTaskId(taskId) {
  var param = "?taskId="+taskId;
  return request({
    url: APIS.V1 + `/system/creditLoanTask/getReviewByTaskId`+param,
    method: 'get'
  })
}

// 提交项目-》开启任务
export function creditStartTask(projectId,orgId) {
  var param = "projectId="+projectId;
  console.log(param)
  return request({
    url: APIS.V1 + `/system/creditLoanTask/startTask`,
    method: 'post',
    data: param
  })
}
export function taskRefer() {
  return request({
    url: APIS.V1 + `/system/creditLoanTask/taskRefer`,
    method: 'get',
  })
}


// 资料复审
export function dataReview(params) {
    return request({
        url: APIS.V1 + `/system/creditLoanTask/dataReview`,
        method: 'post',
        data: params
    })
}

// 确认白名单接口
export function confirmWhiteList(params) {
    return request({
        url: APIS.V1 + `/system/creditLoanTask/confirmWhiteList`,
        method: 'post',
        data: params
    })
}

// app审核
export function appReview(params) {
    return request({
        url: APIS.V1 + `/system/creditLoanTask/appReview`,
        method: 'post',
        data: params
    })
}

// 预约面签
export function signReview(params) {
    return request({
        url: APIS.V1 + `/system/creditLoanTask/signReview`,
        method: 'post',
        data: params
    })
}

// 终审结果
export function finalApproval(params) {
  console.log(params)
    return request({
        url: APIS.V1 + `/system/creditLoanTask/finalApproval`,
        method: 'post',
        data: params
    })
}

// 提款确认
export function confirmDrawMoney(params) {
    return request({
        url: APIS.V1 + `/system/creditLoanTask/confirmDrawMoney`,
        method: 'post',
        data: params
    })
}

export function listHistory(params) {
 console.log(params)
    return request({
        url: APIS.V1 + `/system/creditLoanTask/listHistory`,
        method: 'get',
        params: params
    })
}
// 获取当前项目的APP审核最新信息
export function getAppReviewByProjectId(projectId) {
    return request({
        url: APIS.V1 + `/system/creditLoanTask/getAppReviewByProjectId?projectId=`+projectId,
        method: 'get'
    })
}

// 信用贷重新提交
export function secondSubmit(projectId) {
  return request({
    url: APIS.V1 + `/system/creditLoanTask/secondSubmit?projectId=` + projectId,
    method: 'GET'
  })
}
